<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Http\Requests\Login as LoginRequest;
use App\Model\Project;
use App\Model\User as userModel;
use Illuminate\Support\Facades\Validator;

class Login extends Controller {
	public function __construct(userModel $user, Project $project) {
		$this->user = new $user();
		$this->project = new $project();
	}

	/**
	 * login action
	 *
	 * @param $name
	 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
	 */
	public function index($name) {
		if (!empty($name)) {
			session(['login_source' => $name]);
			session(['project_code' => 'PJ20170801102111']);
		}
		return view($name . '.login', ['name' => $name]);
	}

	public function doLogin(LoginRequest $request) {
        $rule =          [


        ];
		Validator::make($request->all(),[])
		// $userInfo = $this->user->getUserInfo('dd', 'dd');
	}
}
